package com.jkt.rms.business.base;

import java.lang.Comparable;
import java.io.Serializable;


/**
 * This is an object that contains data related to the location table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="location"
 */

public abstract class BaseLocation  implements Comparable, Serializable {

	public static String REF = "Location";
	public static String PROP_STATUS = "status";
	public static String PROP_UPDATED_DATE = "updatedDate";
	public static String PROP_LOCATION_ID = "locationId";
	public static String PROP_UPDATED_BY = "updatedBy";
	public static String PROP_LOCATION_NAME = "locationName";


	// constructors
	public BaseLocation () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseLocation (int locationId) {
		this.setLocationId(locationId);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseLocation (
		int locationId,
		java.util.Date updatedDate,
		java.lang.String updatedBy,
		char status) {

		this.setLocationId(locationId);
		this.setUpdatedDate(updatedDate);
		this.setUpdatedBy(updatedBy);
		this.setStatus(status);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private int locationId;

	// fields
	private java.lang.String locationName;
	private java.util.Date updatedDate;
	private java.lang.String updatedBy;
	private char status;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="location_id"
     */
	public int getLocationId () {
		return locationId;
	}

	/**
	 * Set the unique identifier of this class
	 * @param locationId the new ID
	 */
	public void setLocationId (int locationId) {
		this.locationId = locationId;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: location_name
	 */
	public java.lang.String getLocationName () {
		return locationName;
	}

	/**
	 * Set the value related to the column: location_name
	 * @param locationName the location_name value
	 */
	public void setLocationName (java.lang.String locationName) {
		this.locationName = locationName;
	}



	/**
	 * Return the value associated with the column: updated_date
	 */
	public java.util.Date getUpdatedDate () {
		return updatedDate;
	}

	/**
	 * Set the value related to the column: updated_date
	 * @param updatedDate the updated_date value
	 */
	public void setUpdatedDate (java.util.Date updatedDate) {
		this.updatedDate = updatedDate;
	}



	/**
	 * Return the value associated with the column: updated_by
	 */
	public java.lang.String getUpdatedBy () {
		return updatedBy;
	}

	/**
	 * Set the value related to the column: updated_by
	 * @param updatedBy the updated_by value
	 */
	public void setUpdatedBy (java.lang.String updatedBy) {
		this.updatedBy = updatedBy;
	}



	/**
	 * Return the value associated with the column: status
	 */
	public char getStatus () {
		return status;
	}

	/**
	 * Set the value related to the column: status
	 * @param status the status value
	 */
	public void setStatus (char status) {
		this.status = status;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jkt.rms.business.Location)) return false;
		else {
			com.jkt.rms.business.Location location = (com.jkt.rms.business.Location) obj;
			return (this.getLocationId() == location.getLocationId());
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			return (int) this.getLocationId();
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}


}